home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / Snippets / Toolbox / MDEF.Sample / Sample.r < prev   
Encoding:
Text File  |  1992-07-15  |  5.6 KB  |  272 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  
  3.       Sample.r    -  Resources for the Sample Application
  4.  
  5.       Copyright Apple Computer, Inc. 1985-1987
  6.       All rights reserved.
  7.  
  8. ------------------------------------------------------------------------------*/
  9.  
  10. #include "Types.r"
  11. include "MenuDef.res";
  12.  
  13. /* These define's are used in the MENU resources to disable specific
  14.    menu items. */
  15. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  16. #define MenuItem1    0b00001
  17. #define MenuItem2    0b00010
  18. #define MenuItem3    0b00100
  19. #define MenuItem4    0b01000
  20. #define MenuItem5    0b10000
  21. #define MenuItem6   0b100000
  22.  
  23. resource 'WIND' (128, "Sample Window") {
  24.     {64, 60, 314, 460},
  25.     documentProc, visible, noGoAway, 0x0, "Sample Window"
  26. };
  27.  
  28. resource 'DLOG' (128, "About Sample…") {
  29.     {66, 102, 224, 400},
  30.     dBoxProc, visible, noGoAway, 0x0, 128, ""
  31. };
  32.  
  33. resource 'DITL' (128) {
  34.      {
  35. /* 1 */ {130, 205, 150, 284},
  36.         button {
  37.             enabled,
  38.             "Continue"
  39.         };
  40. /* 2 */ {104, 144, 120, 296},                /* SourceLanguage Item */
  41.         staticText {
  42.             disabled,
  43.             ""
  44.         };
  45. /* 3 */ {88, 144, 105, 218},                /* Author Item */
  46.         staticText {
  47.             disabled,
  48.             ""
  49.         };
  50. /* 4 */ {8, 32, 26, 273},
  51.         staticText {
  52.             disabled,
  53.             "Macintosh Programmer's Workshop"
  54.         };
  55. /* 5 */ {32, 80, 50, 212},
  56.         staticText {
  57.             disabled,
  58.             "Sample Application"
  59.         };
  60. /* 6 */ {56, 16, 74, 281},
  61.         staticText {
  62.             enabled, "Copyright © 1985-1987 Apple Computer"
  63.         };
  64. /* 7 */ {88, 16, 104, 144},
  65.         staticText {
  66.             enabled, "Source Language:"
  67.         };
  68. /* 8 */ {104, 16, 120, 144},
  69.         staticText {
  70.             enabled, "Brought to you by:"
  71.         }
  72.     }
  73. };
  74.  
  75. resource 'MENU' (128, "Apple", preload) {
  76.     128, textMenuProc,
  77.     AllItems & ~MenuItem2,    /* Disable item #2 */
  78.     enabled, apple,
  79.     {
  80.         "About Sample…",
  81.             noicon, nokey, nomark, plain;
  82.         "-",
  83.             noicon, nokey, nomark, plain
  84.     }
  85. };
  86.  
  87. resource 'MENU' (129, "File", preload) {
  88.     129, textMenuProc,
  89.     allEnabled,
  90.     enabled, "File",
  91.     {
  92.         "Quit",
  93.             noicon, "Q", nomark, plain
  94.     }
  95. };
  96.  
  97. resource 'MENU' (126, "File", preload) {
  98.     126, textMenuProc,
  99.     allEnabled,
  100.     enabled, "File",
  101.     {
  102.         "Quit",
  103.             noicon, "Q", nomark, plain
  104.     }
  105. };
  106.  
  107.  
  108. resource 'MENU' (130, "Edit", preload) {
  109.     130, textMenuProc,
  110.     AllItems & ~(MenuItem1 | MenuItem2 | MenuItem6),    /* Disable items #1 & #2 */
  111.     enabled, "Edit",
  112.      {
  113.         "Undo",
  114.             noicon, "Z", nomark, plain;
  115.         "-",
  116.             noicon, nokey, nomark, plain;
  117.         "Cut",
  118.             noicon, "X", nomark, plain;
  119.         "Copy",
  120.             noicon, "C", nomark, plain;
  121.         "Paste",
  122.             noicon, "V", nomark, plain;
  123.         "Clear",
  124.             noicon, hierarchicalMenu, "\0x7E", plain
  125.     }
  126. };
  127.  
  128.  
  129. type 'PSMP' as 'STR ';
  130.  
  131. resource 'PSMP' (0) {
  132.     "Sample Pascal Application - Version 2.0.2"
  133. };
  134.  
  135.  
  136. resource 'ICN#' (128) {
  137.     {    /* array: 2 elements */
  138.         /* [1] */
  139.         $"0000 0000 0000 0000 0000 0000 0000 0000"
  140.         $"0000 0000 07FF FF00 0600 0080 0500 0040"
  141.         $"0480 0020 0440 0010 0420 0008 0410 0004"
  142.         $"040F FFFE 0408 0002 0408 0002 0408 0002"
  143.         $"0408 0002 0408 0002 0408 0002 0408 0002"
  144.         $"0408 0002 0408 0002 0408 0002 0408 0002"
  145.         $"0208 0002 0108 0002 0088 0002 0048 0002"
  146.         $"0028 0002 0018 0002 000F FFFE",
  147.         /* [2] */
  148.         $"000F FFFC 001F FFF8 003F FFF0 007F FFE0"
  149.         $"00FF FFC0 0600 0080 05FF FF80 0792 49C0"
  150.         $"07C9 24E0 07E4 9270 07F2 4918 07FF FFFC"
  151.         $"07FF FFFE 07FF FFFE 07FF FFFE 07FF FFFE"
  152.         $"07FF FFFE 07FF FFFE 07FF FFFE 07FF FFFE"
  153.         $"07FF FFFE 07FF FFFE 07FF FFFE 07FF FFFE"
  154.         $"03FF FFFE 01FF FFFE 00FF FFFE 007F FFFE"
  155.         $"003F FFFE 001F FFFE 000F FFFE"
  156.     }
  157. };
  158.  
  159.  
  160. resource 'BNDL' (128) {
  161.     'PSMP',
  162.     0,
  163.     {
  164.         'ICN#',
  165.         {
  166.             0, 128
  167.         },
  168.         'FREF',
  169.         {
  170.             0, 128
  171.         }
  172.     }
  173. };
  174.  
  175.  
  176. resource 'FREF' (128) {
  177.     'APPL',
  178.     0,
  179.     ""
  180. };
  181.  
  182. resource 'MENU' (26, "Case") {
  183.     26,
  184.     128,
  185.     0x7BF,
  186.     enabled,
  187.     " ",
  188.     {    /* array: 4 elements */
  189.         /* [1] */
  190.         "Upper Case", noIcon, "U", noMark, plain,
  191.         /* [2] */
  192.         "Lower Case", noIcon, "L", noMark, plain,
  193.         /* [3] */
  194.         "Title", 1, "T", noMark, plain,
  195.         /* [4] */
  196.         "Small Caps", noIcon, "S", noMark, plain
  197.     }
  198. };
  199.  
  200. resource 'MENU' (27, "Case") {
  201.     27,
  202.     128,
  203.     0x7BF,
  204.     enabled,
  205.     " ",
  206.     {    /* array: 4 elements */
  207.         /* [1] */
  208.         "Upper Case", noIcon, noKey, noMark, plain,
  209.         /* [2] */
  210.         "Lower Case", noIcon, noKey, noMark, plain,
  211.         /* [3] */
  212.         "Title", noIcon, hierarchicalMenu, "\0x1A", plain,
  213.         /* [4] */
  214.         "Small Caps", noIcon, noKey, noMark, plain
  215.     }
  216. };
  217.  
  218. resource 'MENU' (28, "Case") {
  219.     28,
  220.     TextMenuProc,
  221.     0x7BF,
  222.     enabled,
  223.     " ",
  224.     {    /* array: 4 elements */
  225.         /* [1] */
  226.         "Upper Case", noIcon, noKey, noMark, plain,
  227.         /* [2] */
  228.         "Lower Case", noIcon, noKey, noMark, plain,
  229.         /* [3] */
  230.         "Title", noIcon, noKey, noMark, plain,
  231.         /* [4] */
  232.         "Small Caps", noIcon, noKey, noMark, plain
  233.     }
  234. };
  235.  
  236. resource 'MENU' (11, "Style") {
  237.     11,
  238.     128,
  239.     0b1111111111111111111111111111111,
  240.     enabled,
  241.     "Style",
  242.     {    /* array: 16 elements */
  243.         "Superscript", noIcon, hierarchicalMenu, "\0x1A", plain,
  244.         /* [11] */
  245.         "Subscript", noIcon, hierarchicalMenu, "\0x1B", plain,
  246.         /* [12] */
  247.         "Make this sucker", noIcon, hierarchicalMenu, "\0x1C", plain
  248.     }
  249. };
  250.  
  251. resource 'SIZE' (-1) {
  252.     dontSaveScreen,
  253.     acceptSuspendResumeEvents,
  254.     enableOptionSwitch,
  255.     canBackground,                /* we can background; we don't currently, but our sleep value */
  256.                                 /* guarantees we don't hog the Mac while we are in the background */
  257.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  258.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  259.     GetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  260.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  261.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  262.     reserved,
  263.     reserved,
  264.     reserved,
  265.     reserved,
  266.     reserved,
  267.     reserved,
  268.     reserved,
  269.     300 * 1024,
  270.     128 * 1024    
  271. };
  272.